# -*- coding: utf-8  -*-
#!/usr/local/bin/python

__author__ = 'jian.yao'

from misc.errorcode import ERROR_CODE, ERROR_MESSAGE
from backend import get_token
def SSO_getToken(uid, appid, secret):

    # token = None
    # errorCode = app_check(appid, secret)
    # errorCode = ERROR_CODE.SUCCESS
    # if(errorCode == ERROR_CODE.SUCCESS):
    #     token, errorCode = get_token(uid, appid)
    #     if(token is not None):
    #         return token, ERROR_CODE.SUCCESS
    return None

def SSO_getToken(uid):
    token, errorCode, errorMes = get_token(uid)
    if(token is not None):
        return token, ERROR_CODE.SUCCESS, ERROR_MESSAGE.SUCCESS
    return None, errorCode, errorMes